#include <FS.h>
#include <ArduinoJson.h>

class FileHelper
{
private:
    /* data */
    fs::FS fs;
    std::unique_ptr<uint8_t[]> buf;

public:
    size_t readFile(const char *path, uint8_t* buf);
    size_t readFile(const char *path);
    uint8_t* getFileContent();
    bool deleteFile(const char *path);
    bool writeFile(const char *path, const char *message);
    bool writeFile(const char *path, JsonDocument doc);
    bool appendFile(const char *path, const char *message);
    bool writeRawFile(const char *path, uint8_t *buf, size_t size);
    FileHelper(fs::FS fs);
    ~FileHelper();
};
